<template>
	<view class="wp">
		<view class="user-section">
			<view class="bg"></view>
			<view class="member">
				<image :src="info.member.avatar" mode=""></image>
				<view class="m_info">
					<view class="name">
						<text>昵称：</text>
						<text>{{info.member.nickname}}</text>
					</view>
					<view class="m_id">
						<text>ID：</text>
						<text>{{info.member.id}}</text>
					</view>
					<view class="recommend">
						<text>推荐人：</text>
						<text>{{info.referrer.realname}}</text>
					</view>
					<view v-if="info.levelname['1']">
						<text>VIP权益：</text>
						<text>{{info.lastVipTime}}天</text>
					</view>
					<view v-if="info.levelname['0']">
						<text>会员权益：享受会员折扣</text>
					</view>
				</view>
			</view>
			<view class="buttons">
				<view class="b_li b_li1">
					<!-- 					<image src="/static/user/mem/kefu.png" mode="" @click="openKefu"></image> -->
					<text class="yticon icon-shezhi my_shezhi" @click="$navTo('/pages/user/set')"></text>
				</view>
				<!-- 				<view class="b_li b_li2">
					<view class="shar_image" @click="$navTo('/pages/agent/QRcode')">
						<image src="/static/user/mem/tuiguangyaoqing.png"></image>
						<view>推广邀请</view>
					</view>
				</view> -->
			</view>
			<view class="label">
				<text
					:class="{'item1':idx==0, 'item2':idx==1, 'item3':idx==2, 'item4':idx==3, 'item5':idx==4, 'item6':idx==5,'item7':idx==6 , 'item8':idx==7 , 'item9':idx==8 , 'item7':idx==9}"
					v-for="(item,idx) in info.levelname" :key="idx">{{item}}</text>
			</view>
		</view>

		<view class="c_body">
			<!-- 扫一扫、累计消费-->
			<view class="l_menu">
				<image class="bg" src="/static/user/mem/leiji.png" mode=""></image>
				<view class="l_menu_body">
					<view class="l_menu_item">
						<view>{{info.totalprice}}</view>
						<view class="title">累计消费</view>
					</view>
					<view class="l_menu_item">
						<view>{{info.discontsprice}}</view>
						<view class="title">累计节省</view>
					</view>
<!-- 					<view class="l_menu_item">
						<view>1265</view>
						<view class="title">省钱排名</view>
					</view> -->
					<view class="l_menu_item" style="font-size: 0;" @click="navTo('sao')">
						<image src="/static/user/mem/sao.png" mode=""></image>
						<view class="title">扫一扫</view>
					</view>
				</view>
			</view>
			<view class="notice_bar1">
				<text class="text1" v-if="gradeinfo.type==1">当前身份为<text style="color:darkred;font-weight: bold;">掌柜</text>，推荐<text style="color:darkred;font-weight: bold;">{{gradeinfo.num}}个掌柜</text>即可升级为<text style="color:darkred;font-weight: bold;">导师</text></text>
				<text class="text1" v-if="gradeinfo.type==2 && gradeinfo.num==1">当前<text style="color:darkred;font-weight: bold;">导师</text>爆品分佣为70%，佣金冻结30%，团队下培养<text style="color:darkred;font-weight: bold;">2个导师</text>后可解冻</text>
			</view>
			<view class="notice_bar">
				<uni-notice-bar :speed="14" show-icon scrollable :text="notice" backgroundColor="#f3dd91"
					:showStyle="true" color="#685135" />
			</view>

			<!-- 我的 -->
			<view class="my_menu">
				<view class="title">
					<text class="name">我的</text>
					<text class="more" @click="$navTo('../user/vip')">98元开通VIP年卡></text>
				</view>
				<view class="my_list">
					<view class="list_item" @click="$navTo('/pages/index/order')">
						<image src="/static/user/mem/dingdan.png"></image>
						<view class="name">订单</view>
					</view>
					<view class="list_item" @click="navTo('/pages/user/history')">
						<image src="/static/user/mem/zuji.png"></image>
						<view class="name">浏览记录</view>
					</view>
					<view class="list_item" @click="navTo('/pages/userservice/mycollection')">
						<image src="/static/user/mem/shoucang.png"></image>
						<view class="name">收藏</view>
					</view>
					<view class="list_item" @click="navTo('/pages/address/address')">
						<image src="/static/user/mem/shouhuodizhi.png"></image>
						<view class="name">收货地址</view>
					</view>
					<view class="list_item" @click="navTo('/pages/userservice/myteam')">
						<image src="/static/user/mem/huoban.png"></image>
						<view class="name">我的好友</view>
					</view>
					<view class="list_item" @click="navTo('/pages/agent/QRcode')">
						<image src="/static/user/mem/yaoqing.png"></image>
						<view class="name">邀请好友</view>
					</view>
					<view class="list_item" @click="openKefu">
						<image src="/static/user/mem/kefu01.png"></image>
						<view class="name">在线客服</view>
					</view>
					<view class="list_item" v-if="info.openSupplier==1" @click="navTo('/pages/user/settle')">
						<image src="/static/user/mem/shangjiaruzhu.png"></image>
						<view class="name">商家入驻</view>
					</view>
					<view class="list_item" @click="navTo('/pages/source/addSource')">
						<image src="/static/user/mem/shangjiaruzhu.png"></image>
						<view class="name">发布素材</view>
					</view>
<!-- 					<view class="list_item" @click="navTo('/pages/user/settle')" >
						<image src="/static/user/mem/tuiguangyaoqing.png"></image>
						<view class="name"> </view>
					</view> -->
<!-- 					<view class="list_item" v-if="info.levelname['4']" @click="navTo('/pages/userservice/signing')">
						<image src="/static/user/mem/shangpuguanli.png"></image>
						<view class="name">好友门店</view>
						<uni-badge :text="Number(info.agentwaitnum)" type="primary" :offset="[-10,-42]"
							absolute="rightTop" :customStyle="{background: '#8405dc'}" />
					</view> -->
				</view>
			</view>

			<!-- 商家 -->
			<view class="my_menu" v-if="info.levelname['2']">
				<view class="title">
					<text class="name">我的门店</text>
					<text class="more" @click="phoneCall(supplierInfo.salephone)">联系客户经理：{{supplierInfo.salephone}}></text>
				</view>
				<view class="shop_list">
					<view class="list_item" @click="$navTo('/pages/business/personalstores')">
						<image src="/static/user/mem/shangpuguanli.png"></image>
						<view class="name">门店设置</view>
					</view>
					<view class="list_item" @click="navTo('/pages/user/custom')">
						<image src="/static/user/mem/kehuguanli.png"></image>
						<view class="name">客户管理</view>
					</view>
					<view class="list_item" @click="Popup">
						<image src="/static/user/mem/shujufenxi.png"></image>
						<view class="name" >数据分析</view>
					</view>
					<view class="list_item" @click="navTo('/pages/business/collection')">
						<image src="/static/user/mem/shouKuan.png"></image>
						<view class="name">收款码</view>
					</view>
					<view class="list_item" @click="navTo('/pages/user/prestore')">
						<view class="number color_number">
							<view style="font-size: 28upx;">{{supplierInfo.usemoney}}</view>
							<view>(共享)</view>
						</view>
						<view class="name">会员卡</view>
					</view>
					<view class="list_item">
						<view class="number">
							<view>{{supplierInfo.sharenum}}次</view>
							<view>(累计次数)</view>
						</view>
						<view class="name">店铺分享</view>
					</view>
					<view class="list_item">
						<view class="number">
							<view>{{supplierInfo.shownum}}次</view>
							<view>(当日)</view>
						</view>
						<view class="name">店铺曝光</view>
					</view>
					<view class="list_item">
						<view class="number">
							<view>{{supplierInfo.brownum}}人</view>
							<view>(当日)</view>
						</view>
						<view class="name">店铺访客</view>
					</view>

					<view class="list_item" @click="navTo('/pages/business/collectionrecord')">
						<view class="number">
							<view>{{supplierInfo.ordernum}}笔</view>
							<view>(当日核销)</view>
						</view>
						<view class="name">收款笔数</view>
					</view>
					<view class="list_item" @click="navTo('/pages/business/collectionrecord')">
						<view class="number color_number">
							<view style="font-size: 26upx;">{{supplierInfo.salemoney}}</view>
							<view>(当日)</view>
						</view>
						<view class="name">营业额</view>
					</view>

					<view class="list_item" @click="navTo('../business/orderwrite?status=1')">
						<view class="number">
							<view>{{supplierInfo.nochecknum}}笔</view>
							<view>(当前)</view>
						</view>
						<view class="name">团购待核销</view>
					</view>

					<view class="list_item" @click="navTo('../business/orderwrite?status=-1')">
						<view class="number">
							<view>{{supplierInfo.refundnum}}笔</view>
							<view>(当前)</view>
						</view>
						<view class="name">已退款</view>
					</view>

					<view class="list_item" @click="navTo('../business/orderwrite?status=3')">
						<view class="number">
							<view>{{supplierInfo.finishnum}}笔</view>
							<view>(累计)</view>
						</view>
						<view class="name">已核销</view>
					</view>
					
					<view class="list_item">
						<view class="number color_number">
							<view style="font-size: 26upx;">{{supplierInfo.grouprealprice}}</view>
							<view>(当日)</view>
						</view>
						<view class="name">团购实收</view>
					</view>
					
					<view class="list_item" @click="navTo('/pages/business/collectionrecordgroup')">
						<view class="number color_number">
							<view style="font-size: 26upx;">{{supplierInfo.groupprice}}</view>
							<view>(当日核销)</view>
						</view>
						<view class="name">团购营业额</view>
					</view>

				</view>
			</view>


			<!-- 推广数据 -->
			<view class="my_menu" v-if="info.levelname['3'] || info.levelname['4'] || info.levelname['5'] || info.levelname['6'] || info.levelname['7'] || info.levelname['8'] || info.levelname['9']">
				<view class="title">
					<text class="name">推广收益数据</text>
					<text class="more" @click="$navTo('/pages/user/SetGroupcode')">上传二维码 ></text>
					<text class="more" @click="$navTo('/pages/user/addgroup')">加微信或群 ></text>
				</view>
				<view class="shop_list">
					<view class="list_item"  @click="navTo('/pages/userservice/myteam')">
						<view class="number">
							<view>{{partnerInfo.all}}人</view>
							<view>(累计)</view>
						</view>
						<view class="name">团队人数</view>
					</view>
					<view class="list_item">
						<view class="number">
							<view>{{partnerInfo.vipnum}}人</view>
							<view>(累计)</view>
						</view>
						<view class="name">VIP数量</view>
					</view>
					<view class="list_item">
						<view class="number">
							<view>{{partnerInfo.partnernum}}人</view>
							<view>(累计)</view>
						</view>
						<view class="name">合伙人</view>
					</view>
					<view class="list_item">
						<view class="number">
							<view>{{partnerInfo.areanum}}家</view>
							<view>(累计)</view>
						</view>
						<view class="name">区域代理</view>
					</view>
					<view class="list_item">
						<view class="number">
							<view>{{partnerInfo.newnum}}人</view>
							<view>(团队成员)</view>
						</view>
						<view class="name">今日新增</view>
					</view>
					<view class="list_item">
						<view class="number color_number">
							<view>{{partnerInfo.price}}</view>
							<view>(元)</view>
						</view>
						<view class="name">今日实付</view>
					</view>
					<view class="list_item" @click="$navTo('/pages/agent/Dividendorder')">
						<view class="number color_number">
							<view>{{partnerInfo.curmoeny}}</view>
							<view>(预估)</view>
						</view>
						<view class="name">今日收益</view>
					</view>

					<view class="list_item" @click="$navTo('/pages/agent/Dividendorder')">
						<view class="number color_number">
							<view>{{partnerInfo.waitmoney}}</view>
							<view>(元)</view>
						</view>
						<view class="name">待结算</view>
					</view>

					<view class="list_item">
						<view class="number color_number">
							<view>{{partnerInfo.allmoney}}</view>
							<view>(累计)</view>
						</view>
						<view class="name">已结算</view>
					</view>
					
					<view class="list_item" @click="$navTo('../userservice/withdrawal')">
						<view class="number color_number">
							<view>{{partnerInfo.usemoney}}</view>
							<view>(元)</view>
						</view>
						<view class="name">可提现</view>
					</view>


				</view>
			</view>

			<!-- 业务经理签约门店 -->
			<view class="my_menu" v-if="info.levelname['3']">
				<view class="title">
					<text class="name">业务门店</text>
					<text class="more" @click="$navTo('/pages/user/SetGroupcode')">上传二维码 ></text>
				</view>
				<view class="shop_list">
					<!-- <view class="list_item" @click="navTo('/pages/user/signing')"> 原业务经理跳转签约门店	  -->
					<view class="list_item" @click="navTo('/pages/user/dlmanageshop')"> 
						<image src="/static/user/mem/shangpuguanli.png"></image>
						<view class="name">已签门店</view>
					</view>
					<view class="list_item" @click="navTo('/pages/user/examine')">
						<image src="/static/user/mem/daishenhe.png"></image>
						<view class="name">待审核</view>
						<uni-badge :text="Number(salerInfo.waitchecknum)" type="primary" :offset="[-10,-42]"
							absolute="rightTop" :customStyle="{background: '#8405dc'}" />
						<uni-badge :text="Number(areagentInfo.waitchecknum)" type="primary" :offset="[-10,-42]"
							absolute="rightTop" :customStyle="{background: '#8405dc'}" />
					</view>
					<view class="list_item" @click="navTo('/pages/user/signing?usemoney>=15')">
						<view class="number">
							<view>{{salerInfo.usemoney}}万</view>
							<view>(当日)</view>
						</view>
						<view class="name">预存余额</view>
					</view>
					<view class="list_item">
						<view class="number">
							<view>{{salerInfo.supmoney}}</view>
							<view>(当日)</view>
						</view>
						<view class="name">预存消费</view>
					</view>
					<view class="list_item">
						<view class="number color_number">
							<view>{{salerInfo.saleprice}}</view>
							<view>(当日实付)</view>
						</view>
						<view class="name">营业额</view>
					</view>
					<view class="list_item" @click="$navTo('/pages/user/signing')">
						<view class="number">
							<view>{{salerInfo.supnum}}家</view>
							<view>(累计)</view>
						</view>
						<view class="name">门店数量</view>
					</view>
					<view class="list_item" @click="navTo('/pages/user/signing?price=0')">
						<view class="number">
							<view>{{salerInfo.nopaynum}}家</view>
							<view>(无交易门店)</view>
						</view>
						<view class="name">门店预警</view>
					</view>
					<view class="list_item">
						<view class="number">
							<view>{{salerInfo.brownum}}人</view>
							<view>(当日)</view>
						</view>
						<view class="name">店铺访客</view>
					</view>

					<view class="list_item">
						<view class="number">
							<view>{{salerInfo.ordernum}}笔</view>
							<view>(当日)</view>
						</view>
						<view class="name">支付笔数</view>
					</view>
				</view>
			</view>

			<!-- 区域代理商 -->
			<view class="my_menu" v-if="info.levelname['9']">
				<!-- <view class="my_menu" > -->
				<view class="title">
					<text class="name">区域代理商</text>
				</view>
				<view class="shop_list">
					<view class="list_item" @click="$navTo('/pages/user/dlmanageshop')">
						<image src="/static/user/mem/shangpuguanli.png"></image>
						<view class="name">已签门店</view>
					</view>
					<view class="list_item" @click="$navTo('/pages/user/dlpersonnel')">
						<image src="/static/user/mem/renyuanguanli.png"></image>
						<view class="name">业务经理</view>
					</view>
					<view class="list_item" @click="$navTo('/pages/user/dlapprove')">
						<image src="/static/user/mem/daishenhe.png"></image>
						<view class="name">门店审批</view>
						<uni-badge :text="Number(areagentInfo.waitchecknum)" type="primary" :offset="[-10,-42]"
							absolute="rightTop" :customStyle="{background: '#8405dc'}" />
					</view>
					<view class="list_item">
						<image src="/static/user/mem/shujufenxi.png"></image>
						<view class="name">数据分析</view>
					</view>
					<view class="list_item" @click="$navTo('/pages/user/shoplist')">
						<image src="/static/user/mem/yufuguanli.png"></image>
						<view class="name">充值管理</view>
					</view>
					<view class="list_item">
						<view class="number">
							<view>{{areagentInfo.supnum}}家</view>
							<view>(累计)</view>
						</view>
						<view class="name" @click="navTo('/pages/user/dlmanageshop')">门店数量</view>
					</view>
					<view class="list_item">
						<view class="number">
							<view>{{areagentInfo.brownum}}人</view>
							<view>(当日)</view>
						</view>
						<view class="name">本地访客</view>
					</view>
					<view class="list_item">
						<view class="number">
							<view>{{areagentInfo.ordernum}}人</view>
							<view>(当日)</view>
						</view>
						<view class="name">消费人数</view>
					</view>
					<!-- 					<view class="list_item">
						<view class="number">
							<view>{{areagentInfo.usemoney}}万</view>
							<view>(当日)</view>
						</view>
						<view class="name">预存余额</view>
					</view> -->
					<view class="list_item">
						<view class="number color_number">
							<view>{{areagentInfo.usemoney}}万</view>
							<view>(当日)</view>
						</view>

						<view class="name">预存余额</view>
					</view>

					<view class="list_item">
						<view class="number color_number">
							<view>{{areagentInfo.saleprice}}</view>
							<view>(当日营收)</view>
						</view>

						<view class="name">营业额</view>
					</view>
				</view>
			</view>

			<!-- 运营公司 -->
			<view class="my_menu" v-if="info.levelname['8']">
				<!-- <view class="my_menu" > -->
				<view class="title">
					<text class="name">运营公司</text>
				</view>
				<view class="shop_list">
					<view class="list_item" @click="$navTo('/pages/user/dlmanageshop')">
						<image src="/static/user/mem/shangpuguanli.png"></image>
						<view class="name">已签门店</view>
					</view>
					<view class="list_item" @click="$navTo('/pages/user/dlpersonnel')">
						<image src="/static/user/mem/renyuanguanli.png"></image>
						<view class="name">直推人员</view>
					</view>
<!-- 					<view class="list_item" @click="$navTo('/pages/user/dlapprove')">
						<image src="/static/user/mem/daishenhe.png"></image>
						<view class="name">门店审批</view>
						<uni-badge :text="Number(areagentInfo.waitchecknum)" type="primary" :offset="[-10,-42]"
							absolute="rightTop" :customStyle="{background: '#8405dc'}" />
					</view> -->
					<view class="list_item">
						<image src="/static/user/mem/shujufenxi.png"></image>
						<view class="name">数据分析</view>
					</view>
<!-- 					<view class="list_item" @click="$navTo('/pages/user/shoplist')">
						<image src="/static/user/mem/yufuguanli.png"></image>
						<view class="name">充值管理</view>
					</view> -->
					<view class="list_item">
						<view class="number">
							<view>{{areagentInfo.supnum}}家</view>
							<view>(累计)</view>
						</view>
						<view class="name" @click="navTo('/pages/user/dlmanageshop')">门店数量</view>
					</view>
					<view class="list_item">
						<view class="number">
							<view>{{areagentInfo.brownum}}人</view>
							<view>(当日)</view>
						</view>
						<view class="name">本地访客</view>
					</view>
					<view class="list_item">
						<view class="number">
							<view>{{areagentInfo.ordernum}}人</view>
							<view>(当日)</view>
						</view>
						<view class="name">消费人数</view>
					</view>
					<!-- 					<view class="list_item">
						<view class="number">
							<view>{{areagentInfo.usemoney}}万</view>
							<view>(当日)</view>
						</view>
						<view class="name">预存余额</view>
					</view> -->
					<view class="list_item">
						<view class="number color_number">
							<view>{{areagentInfo.usemoney}}万</view>
							<view>(当日)</view>
						</view>

						<view class="name">预存余额</view>
					</view>

					<view class="list_item">
						<view class="number color_number">
							<view>{{areagentInfo.saleprice}}</view>
							<view>(当日营收)</view>
						</view>

						<view class="name">营业额</view>
					</view>
				</view>
			</view>



			<!-- 其它 -->
			<view class="my_menu">
				<view class="title">
					<text class="name">其他</text>
				</view>
				<view class="shop_list">
					<view class="list_item" @click="navTo('/pages/other/aboutus')">
						<image src="/static/user/mem/guanyuwomen.png"></image>
						<view class="name">关于我们</view>
					</view>
					<view class="list_item" @click="navTo('/pages/other/noviceguide')">
						<image src="/static/user/mem/xinshouzhinan.png"></image>
						<view class="name">新手指南</view>
					</view>


					<view class="list_item" @click="navTo('/pages/other/college')" 
						v-if="info.levelname['3'] || info.levelname['4'] || info.levelname['5'] || info.levelname['6']">
						<image src="/static/user/mem/peixun.png"></image>
						<view class="name">推广培训</view>
					</view>

					<!-- 					<view class="list_item" @click="navTo('/pages/other/joinin')">
						<image src="/static/user/mem/jiameng.png"></image>
						<view class="name">加盟</view>
					</view> -->
					<!-- 					<view class="list_item" @click="navTo('/pages/other/feedback')">
						<image src="/static/user/mem/yijiang.png"></image>
						<view class="name">投诉</view>
					</view> -->
				</view>
			</view>
		</view>
		<uni-popup ref="popup" :is-mask-click="false">
			<view class="empower">
				<image v-if="user.avatar" :src="user.avatar" mode=""></image>
				<button v-else type="default" open-type="chooseAvatar" @chooseavatar="getAvatar">获取微信头像</button>
				<input type="nickname" class="weui-input" placeholder="请输入昵称" v-model="user.nickname" name="nickname"
					@blur="getnickname" />
				<button @click="sumbitUsr" class="submit_btn">提交</button>
			</view>
		</uni-popup>
	</view>
</template>
<script>
	// import uniBadge from '@/components/uni-badge/uni-badge.vue'
	import {
		mapState
	} from 'vuex';
	export default {
		computed: {
			...mapState(["url"])
		},
		data() {
			return {
				info: {
					openSupplier: 0,
					discontsprice: '',
					lastVipTime: '',
					levelname: {},
					agentwaitnum: 0,
					member: {
						avatar: "",
						id: "",
						nickname: "",
					},
					referrer: {
						realname: ''
					},
					totalprice: ''
				},
				user: {
					avatar: '',
					nickname: ''
				},
				notice: [],
				gradeinfo:{
					type:0,
					num:0,
				},

				supplierInfo: {
					brownum: "0",
					ordernum: "0",
					salemoney: "0.00",
					sharenum: "0",
					shownum: 0,
					usemoney: "0.00",
					nochecknum: "",
					refundnum: "",
					finishnum: "",
					groupprice: "0.00",
				},

				partnerInfo: {
					all: 0,
					allmoney: 0,
					areanum: 0,
					curmoeny: 0,
					newnum: 0,
					partnernum: 0,
					price: 0,
					usemoney: 0,
					vipnum: 0,
					waitmoney: 0
				},
				salerInfo: {
					brownum: 0,
					nopaynum: 0,
					ordernum: 0,
					saleprice: 0,
					supmoney: 0,
					supnum: 0,
					usemoney: 0,
					waitchecknum: 0
				},
				areagentInfo: {
					brownum: 0,
					ordernum: 0,
					saleprice: 0,
					supnum: 0,
					usemoney: 0,
					waitchecknum: 0
				},
			}
		},
		onShow() {
			this.getInfo();
			this.getNotice();
			this.getGradeInfo();
		},
		methods: {
			Popup() {  // 临时提醒
				uni.showModal({
					title: '提示',
					content: '数据分析正在开发中……',
					cancelText: "取消", // 取消按钮的文字  
					confirmText: "确认", // 确认按钮的文字  
					showCancel: true, // 是否显示取消按钮，默认为 true 显示
					confirmColor: '#f55850',
					cancelColor: '#39B54A',
					success: (res) => {
						if(res.confirm) {  
							////点击确之后执行的代码
						} else {  
							console.log('cancel') //点击取消之后执行的代码
						}  
					} 
				})
			},
			getAvatar(v) {
				let that = this;
				uni.showLoading({
					title: '请稍后',
					mask: true
				});
				let token = uni.getStorageSync('token');
				uni.uploadFile({
					url: that.url.upload,
					filePath: v.detail.avatarUrl,
					name: 'a',
					header: {
						token: token
					},
					formData: {
						'file': 'a'
					},
					success(res) {
						let data = JSON.parse(res.data);
						if (data.code == 200) {
							that.user.avatar = data.data.url;
						} else {
							uni.showToast({
								title: '获取失败请重试',
								icon: 'none'
							})
						}
					},
					fail() {
						uni.showToast({
							title: '获取失败请重试',
							icon: 'none'
						})
					},
					complete() {
						uni.hideLoading();
					}
				})
			},
			getnickname(e) {
				this.user.nickname = e.detail.value;
			},
			getNotice() {
				this.$axios('center/notice', "POST", 'member').then(res => {
					if (res.data.code == 200) {
						this.notice = res.data.data.join(' ');
					}
				})
			},
			sumbitUsr() {
				if ( this.user.nickname === '') {
					this.$api.msg('请完善提交信息！');
					return;
				}
				this.$axios('info/setMemberAvatar', "POST", 'member', this.user).then(res => {
					if (res.data.code == 200) {
						this.$api.msg('提交成功！');
						this.$refs.popup.close();
					}
				})
			},
			getInfo() {
				this.$axios('Center/main', "POST", 'member').then(res => {
					if (res.data.code == 200) {
						this.info = res.data.data;
						if (this.info.isopenavatar) this.$refs.popup.open();
						if (this.info.levelname['2']) this.getSupplierInfo();
						if (this.info.levelname['2'] || this.info.levelname['3'] || this.info.levelname['4'] || this.info.levelname['5'] || this.info.levelname['6'] || this.info.levelname['7'] || this.info.levelname['8'] || this.info.levelname['9']) this.getPartner();
						if (this.info.levelname['3']) this.getSaler();
						if (this.info.levelname['9']) this.getAreagent();
					}
				})
			},
			getSupplierInfo() {
				this.$axios('center/getSupplier', "POST", 'member').then(res => {
					if (res.data.code == 200) {
						this.supplierInfo = res.data.data;
					}
				})
			},
			getGradeInfo() {
				this.$axios('center/getGradeInfo', "POST", 'member').then(res => {
					if (res.data.code == 200) {
						this.gradeinfo = res.data.data;
					}
				})
			},
			
			getPartner() {
				this.$axios('center/getPartner', "POST", 'member').then(res => {
					if (res.data.code == 200) {
						this.partnerInfo = res.data.data;
					}
				})
			},
			getSaler() {
				this.$axios('center/getSaler', "POST", 'member').then(res => {
					if (res.data.code == 200) {
						this.salerInfo = res.data.data;
					}
				})
			},
			getAreagent() {
				this.$axios('center/getAreagent', "POST", 'member').then(res => {
					if (res.data.code == 200) {
						this.areagentInfo = res.data.data;
					}
				})
			},
			phoneCall(v) {
				uni.makePhoneCall({
					phoneNumber: v
				})
			},
			openKefu() {
				let that = this;
				wx.openCustomerServiceChat({
					extInfo: {
						url: 'https://work.weixin.qq.com/kfid/kfc85558bf452926a1b',
					},
					corpId: 'ww818270697fafba52',
					fail(res) {
						that.$api.msg('打开失败请重试！');
					}
				})
			},
			navTo(url, type) {
				if (type && this.info.ismerch != 1) {
					this.$navTo('/pages/userservice/settled');
					return;
				}
				let that = this;
				if (url == 'sao') {   //扫一扫
					uni.scanCode({
						success: function(res) {
							let url = res.result;
							if (res.result.indexOf('https://h5.jinghushi.com/orderpay') != -1) {
								url = url.replace('https://h5.jinghushi.com/orderpay',
									'/pages/business/accounts');
							}
							that.$navTo(url);
						},
						fail(error) {
							that.$api.msg('扫码失败')
						}
					})
				} else {
					uni.navigateTo({
						url
					})
				}
			}
		}
	}
</script>
<style lang='scss'>
	page {
		background-color: #f2f2f2;
		color: $font-color-dark;
		font-size: 26upx;
	}

	.wp {
		padding-bottom: 60upx;
	}

	.user-section {
		color: #fff;
		height: 350upx;
		padding-top: 14upx;
		position: relative;

		.bg {
			background: linear-gradient(to bottom, #ff7101, #f03201);
			position: absolute;
			left: 0;
			top: -4upx;
			width: 100%;
			height: 100%;
			/* background-image: linear-gradient(to top, #3f51b1 0%, #5a55ae 13%, #7b5fac 25%, #8f6aae 38%, #a86aa4 50%, #cc6b8e 62%, #f18271 75%, #f3a469 83%, #f7c978 103%); */
			background-image: linear-gradient(#c902e2,#6600fb);
		}

		.member {
			display: flex;
			align-items: center;
			font-size: 30upx;
			padding: 0 60upx;
			position: relative;
			z-index: 90;

			image {
				border-radius: 50%;
				box-shadow: 0 0 10px 1px rgba(0, 0, 0, .3);
				height: 120upx;
				width: 120upx;
			}

			.m_info {
				flex: 1;
				line-height: 40upx;
				padding-left: 20upx;
			}
		}

		.buttons {
			position: absolute;
			right: 0;
			top: 0;
			z-index: 90;

			.b_li {
				display: flex;
			}

			.b_li1 {
				align-items: center;
				justify-content: flex-end;

				image {
					height: 65upx;
					width: 65upx;
				}

				text {
					font-size: 60upx;
					margin: 0 20upx;
				}
			}

			.b_li2 {
				align-items: flex-end;
				justify-content: flex-end;

				.shar_image {
					text-align: center;
					padding: 20upx 20upx 0;

					image {
						height: 55upx;
						width: 55upx;
					}
				}
			}
		}

		.label {
			display: flex;
			align-items: center;
			padding: 26upx 0 0 36upx;
			position: relative;
			z-index: 90;

			text {
				border-radius: 6upx;
				color: #f3dd91;
				display: inline-block;
				letter-spacing: 1px;
				margin-right: 20upx;
				padding: 2upx 10upx;
			}

			.item1 {
				background: #f3dd91;
				color: #927419;
			}

			.item2 {
				background: #000;
				color: #f3dd91;
			}

			.item3 {
				background: #66061a;
			}

			.item4 {
				background: #420477;
			}

			.item5 {
				background: #140885;
			}

			.item6 {
				background: #0783aa;
			}

			.item7 {
				background: #183603;
			}
			
			.item8 {
					background: #640534;
				}
			
			.item9 {
					background: #000000;
				}
			
		}

	}

	.c_body {
		margin-top: -100upx;
		position: relative;

		.l_menu {
			height: calc((100vw - 60upx)*466/1920);
			padding: 0 30upx;
			width: 100%;

			.bg {
				border-radius: 20upx;
				width: 100%;
				height: 100%;
			}

			.l_menu_body {
				display: flex;
				align-items: center;
				height: calc((100vw - 60upx)*466/1920);
				position: absolute;
				top: 0;
				left: 30upx;
				width: calc(100vw - 60upx);
				z-index: 90;

				.l_menu_item {
					color: #f3dd91;
					flex: 1;
					text-align: center;
					height: 130upx;

					image {
						height: 65upx;
						width: 65upx;
					}

					view {
						font-size: 36upx;
						line-height: 65upx;
						height: 65upx;
					}

					.title {
						color: #fff;
						font-size: 26upx;
					}
				}
			}
		}

		.notice_bar1 {
			padding: 5px 0 0 0;
			margin: 20upx 20upx 10upx 20upx;
		}
		.text1{
			color: #888;
			font-size: 30upx;

			
				
		}
		.notice_bar {
			padding: 0px 0 5px 0;
		}
		.uni-noticebar {
			margin-bottom: 0 !important;
		}

		.my_menu {
			background: #fff;
			border-radius: 30upx;
			margin: 0 30upx 20upx;
			padding: 0 20upx 30upx;

			.title {
				border-bottom: 1px hsl(0, 0%, 67%) solid; 
				display: flex;
				align-items: center;
				justify-content: space-between;
				font-weight: bold;
				line-height: 80upx;

				.name {
					color: #000;
					font-size: 30upx;
				}

				.more {
					color: #7f6545;
					letter-spacing: 1px;
					margin-right: 3upx;
				}
			}

			.my_list,
			.shop_list {
				display: flex;
				align-items: center;
				flex-wrap: wrap;

				.list_item {
					text-align: center;
					padding-top: 30upx;
					font-size: 0;
					width: 25%;
					position: relative;

					image {
						margin: 10upx 0;
						height: 50upx;
						width: 50upx;
					}

					.name {
						font-size: 26upx;
					}
				}
			}

			.shop_list {
				.list_item {
					width: 20%;

					.number {
						color: #000;
						height: 70upx;
						font-size: 30upx;
						font-weight: bold;

						view:nth-of-type(2) {
							color: #666;
							font-size: 20upx;
						}
					}

					.color_number {
						color: #8405dc;
					}
				}
			}
		}
	}

	.empower {
		background: #fff;
		border-radius: 20upx;
		padding: 40upx 20upx;

		input {
			background-color: #f8f8f8;
			border: 1px #DCDFE6 solid;
			border-radius: 15upx;
			margin: 20upx 0;
			font-size: 30upx;
			height: 80upx;
			text-align: center;
		}

		image {
			display: block;
			margin: 0 auto;
			border-radius: 20upx;
			height: 150upx;
			width: 150upx;

		}

		button {
			font-size: 30upx;
		}
		.submit_btn{
			color: #fff;
			background: #ff7101;
		}
	}
</style>